//
//  MYGShareValidityPeriodAlert.swift
//  MYDoctor
//
//  Created by Denny on 2024/5/7.
//

import UIKit

class MYGShareValidityPeriodAlert: UIView {
    var tapCancelCompletion:(()->Void)?
    var tapSureCompletion:((String)->Void)?
    var selectValue = ""
    @IBAction func changeType(_ sender: Any) {
        MYGHelp.getChooseResult(dict: ["0":"七天","1":"1个月","2":"3个月","3":"一年","4":"永久"], action: {[weak self] (key, value) in
            self?.selectValue = value
            self?.contentTF.text = value
        })
    }
    @IBOutlet weak var contentTF: UITextField!
    @IBAction func tapCancel(_ sender: Any) {
        if let c = tapCancelCompletion {
            c()
        }
        
    }
    @IBAction func tapShare(_ sender: Any) {
        if selectValue.count == 0 {return}
        if let c = tapSureCompletion {
            c(selectValue)
        }
        
    }
    override  func awakeFromNib() {
        self.layer.cornerRadius = 12
        self.layer.masksToBounds = true
    }
}
